﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using thinger.AutomaticStoreMotionModels;

namespace thinger.AutomaticStoreMotionDAL
{
    public class SysAdminService
    {
        #region 获取所有的用户信息集合
        /// <summary>
        /// 获取所有的用户信息集合
        /// </summary>
        /// <returns></returns>
        public static List<SysAdmin> GetAllAdminDB()
        {
            return SqlSugarHelper.SqlSugarClient.Queryable<SysAdmin>().Where(c => c.LoginName != "Admin").ToList();
        }
        #endregion

        #region 用户信息登录验证
        /// <summary>
        ///用户信息登录验证
        /// </summary>
        /// <param name="sysAdmin">用户信息</param>
        /// <returns>用户信息</returns>
        public static SysAdmin AdminLogin(SysAdmin sysAdmin)
        {
            List<SysAdmin> list = SqlSugarHelper.SqlSugarClient.Queryable<SysAdmin>().Where(c => c.LoginName == sysAdmin.LoginName && c.LoginPwd == sysAdmin.LoginPwd).ToList();
            return list.Count == 0 ? null : list[0];
        }
        #endregion
    }
}
